<?php
class Solicitudes_Form_Informe extends Form_Cna {
	
	public function __construct($options = null) {
		parent::__construct($options);
	}
	
	public function init($a=false) {
		$domConfig = Zend_Registry::get('domConfig');
		$appConfig = Zend_Registry::get('appConfig');
		
		$this->setName('informe');
		$this->setMethod("post");
		$this->setEnctype('multipart/form-data');
		
		$array_elements[] = new Zend_Form_Element_Hidden("codinforme");
		$array_elements[] = new Zend_Form_Element_Hidden("tipotexto");
		
		$element = new Zend_Form_Element_Textarea('texto');
		$element->setLabel('');
		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
//		$element->addFilter('StringToUpper');
		$element->setAttrib("rows",10);
		$element->setAttrib("style","width:99%");
		$element->addValidator('StringLength', false, array($domConfig->TEXTO_TAMANOMIN));
        $array_elements[] = $element;

	    $element = new Zend_Form_Element_Text('textodebilidades');
		$element->setValue('Establezca las debilidades del programa evaluado');
		$element->helper = "formNote";
        $array_elements[] = $element;
        
		$element = new Zend_Form_Element_Textarea('texto2');
		$element->setLabel('Debilidades');
//		$element->setRequired(true);
		$element->addFilter('StripTags');
		$element->addFilter('StringTrim');
//		$element->addFilter('StringToUpper');
		$element->setAttrib("rows",10);
		$element->setAttrib("style","width:99%");
		$element->addValidator('StringLength', false, array($domConfig->TEXTO_TAMANOMIN));
        $array_elements[] = $element;
        
        $element = new Zend_Form_Element_Text("textoarchivo");
        $element->setValue('Tamaño máximo <strong>10 Mb. </strong> Extensiones admitidas (.doc, .docx, .ppt, .pptx, .pdf, .gif, .jpg, .jpeg, .bmp, .png, .zip, .rar)');
        $element->helper = "formNote";
        $element->setAttrib("readonly", "readonly");
        $element->setAttrib("size", 7);
        $array_elements[] = $element;
        
		$element = new Zend_Form_Element_File('archivo');
		$element->setLabel('Adjuntar archivo :');
        $element->setMaxFileSize(10485760);
		$element->addValidator('Size', false, 10485760); // 10MB = 10,485,760 bytes
        $element->setDestination($appConfig->get("ruta_archivos"));
//        $element->setRequired(true);
        $element->setValueDisabled(true);
        $element->addValidator('Extension', false, $domConfig->EXTENSIONES_ARCHIVOS);
		$array_elements[] = $element;
		
		$element = new Zend_Form_Element_Submit ( 'btnSubmit' );
		$element->setValue('Guardar');
		$element->setLabel("Guardar");
		$element->setAttrib("class", "iceCmdBtn");
		$array_elements[] = $element;
		
		$this->addElements ($array_elements);
		
		$this->loadTableDecorators();
		$this->getElement("texto")->setDecorators($this->_buttonDecorators);
		$this->getElement("textodebilidades")->setDecorators($this->_buttonDecorators);
		$this->getElement("texto2")->setDecorators($this->_buttonDecorators);
		$this->getElement("textoarchivo")->setDecorators($this->_buttonDecorators);
	}
	
}